//
// Created by Jisam on 23/10/2024 22:08.
// Solution of  template
#include <bits/stdc++.h>

#define  int long long
#define  endl "\n"
#define  all(x) (x).begin(),(x).end()
#define  pb push_back
using namespace std;


signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    int n = 4;

    vector<int> a(n); 
    int cnt[5]={};   
    for(int i = 0 ; i < n ; i ++) {
        cin >> a[i];
        cnt[a[i]] ++;
    }
    int ans = 0;
    for(int i = 1; i <= 4; i ++){
        ans += cnt[i] / 2;
    }
    cout << ans;
    return 0;
}